#include "mainmenu.hpp"

int main(int argc,char* argv[]){
	using namespace MFUI;
	if(openlib()){
		TTF_Font* font=TTF_OpenFont("./siyuan.ttf",16);
		if(!font){
			printf("font error %s\n",SDL_GetError());
			return -1;
		}
		auto w=new Window("libVN",1280,720,SDL_WINDOW_RESIZABLE|SDL_WINDOW_OPENGL,new Node());
		auto mainmenu=new VN2::MainMenuLayout(w->texturefromfile("test.jpg"),{255,255,255,120});
		mainmenu->addchild(w,new VN2::OptionMenu(font));
		mainmenu->setsize({1280.F,720.F});
		w->connectwindowresize(mainmenu);
		w->setroot(mainmenu);
		Window::main(30);
		TTF_CloseFont(font);
		closelib();
		return 0;
	}
	printf("SDL2 init error %s\n",SDL_GetError());
	return -1;
}